package net.aiion.weave.impl.xml;

import java.util.Collection;

import net.aiion.weave.spi.xml.XmlContext;
import net.aiion.weave.spi.xml.XmlSink;
import net.aiion.weave.spi.xml.events.XmlEvent;

public class XmlCollectionWriterSinkImpl implements XmlSink
{
    private final Collection<XmlEvent> xmlEvents;

    public XmlCollectionWriterSinkImpl(final Collection<XmlEvent> aXmlEvents) {
        xmlEvents = aXmlEvents;
    }

    @Override
    public void handleXmlEvent(final XmlContext aXmlContext) {
        xmlEvents.add(aXmlContext.getXmlEvent());
    }
}
